﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PhanCongGiangDay
{
    public partial class BCGiangVien : Form
    {
        public BCGiangVien()
        {
            InitializeComponent();
        }
        
        private void BCGiangVien_Load(object sender, EventArgs e)
        {         
            List<MGiangVien> list = new List<MGiangVien>();
            DataSetGV dsGV = new DataSetGV();
            list = CGiangVien.getAllGV();
            
            foreach (var item in list)
            {
                DataRow row = dsGV.Tables["GiangVien"].NewRow();
                row["MaGV"] = item.MAGV;
                row["TenGV"] = item.HOTEN;
                row["MaBM"] = item.MABM;
                row["TenBM"] = item.TENBM;
                dsGV.Tables["GiangVien"].Rows.Add(row);
            }
            CRGiangVien rp = new CRGiangVien();
            rp.SetDataSource(dsGV.Tables["GiangVien"]);
           crystalReportGV.ReportSource = rp;
           crystalReportGV.Refresh();          
           
        }
    
     }
}
